#define _CRT_SECURE_NO_WARNINGS
#include "Tree.h"
BTNode* buyNode(BTDataType x) {
	BTNode* node = (BTNode*)malloc(sizeof(BTNode));
	node->data = x;
	node->left = node->right = NULL;

	return node;
}
BTNode* createBinaryTree() {
	BTNode* nodeA = buyNode('A');
	BTNode* nodeB = buyNode('B');
	BTNode* nodeC = buyNode('C');
	BTNode* nodeD = buyNode('D');
	BTNode* nodeE = buyNode('E');
	BTNode* nodeF = buyNode('F');
	nodeA->left = nodeB;
	nodeA->right = nodeC;
	nodeB->left = nodeD;
	nodeC->left = nodeE;
	nodeC->right = nodeF;

	return nodeA;
}

void test() {
	BTNode* tmp = createBinaryTree();
	preOrder(tmp);
	printf("\n");
	InOrder(tmp);
	printf("\n");
	postOrder(tmp); 
	printf("\n");
	LevelOrder(tmp);
	printf("\n");
	printf("%d\n", BinaryTreeSize(tmp));
	printf("%d\n", BinaryTreeLeafSize(tmp));
	printf("%d\n", BinaryTreeLevelKSize(tmp, 2));
	printf("%d\n", BinaryTreeDepth(tmp));
	printf("%c\n", BinaryTreeFind(tmp, 'C')->left->data);
	if (BinaryTreeComplete(tmp))printf("T");
	else printf("F");
	BinaryTreeDestroy(&tmp);
}
int main() {
	test();

	return 0;
}